<%@page import="persistence.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="controller.*"%> 
<%

    
    //ObtencionBaseDatos
    AccesoBD abd =((AccesoBD)session.getAttribute("conex"));
    
    String username,subMenu;
        if(session.getAttribute("username")==null){
           username="Usuario";
           subMenu="Login.jsp";
        }else{
            username= (String)session.getAttribute("username");
            subMenu="salir.jsp";
        }
    try{
         //InicializacionDeLaTransaccion;
        abd.iniciarTransaccion();
        GenerarHTMLAdmin html=new GenerarHTMLAdmin();
        out.print(html.generarHTMLHead("Admin. de Propiedades"));
        out.print(html.generarHTMLMenu(username,subMenu));
        out.print(html.GenerarMainConten());
        out.print(html.GenerarAdminHeaderBorder(request,abd));
        out.print(html.generarHTMLFooter());
        out.print(html.generarHTMLFinal());        
        //ConcretaLaTransaccion;
        
        abd.concretarTransaccion();
        session.setAttribute("conex",  null);
    }catch(Exception e){
       //DeshaceLosCambiosEnLaBD
        abd.rollbackTransaccion();
        System.out.println(e);
   }
%>